import axios from 'axios'
axios.defaults.baseURL='http://codinglin.top:9898'
axios.interceptors.request.use(config => {
  config.headers.Authorization =  sessionStorage.getItem("token")
  return config;
})
axios.interceptors.response.use( response => {
  if (response.data.code == '401') {
    localStorage.removeItem('token');
  } else {
    return response;
  }
})